from fastapi_amis_admin.admin import admin
from fastapi_amis_admin.amis import PageSchema

from apps.category.models import Category
from sample1_server import site


@site.register_admin
class CategoryAdmin(admin.ModelAdmin):
    group_schema = PageSchema(label='Articles', icon='fa fa-wordpress')
    page_schema = PageSchema(label='分类管理', icon='fa fa-folder')
    model = Category
    search_fields = [Category.name]